package top.yesjava.webfinal.service;

import top.yesjava.webfinal.common.utils.PageInfo;
import top.yesjava.webfinal.dao.StudentDao;
import top.yesjava.webfinal.entity.Student;

import java.util.List;

public class StudentService {
    StudentDao studentDao = new StudentDao();
    public List<Student> findAllStudents(){
        return studentDao.selectAllStudents();
    }

    /**
     * 分页查询
     * @param pageNo
     * @param pageSize
     * @return
     */
    public PageInfo<Student> findStudentsByPage(int pageNo,int pageSize){
        return studentDao.selectStudentsByPage(pageNo,pageSize);
    }

    /**
     * 根据id 查询学生对象
     * @param id
     * @return
     */
    public Student getStudentById(Integer id){
        return studentDao.selectStudentById(id);
    }


    public void removeStudentById(Integer... id){
         studentDao.delStudents(id);
    }
}
